package com.zhiyou100.controller;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zhiyou100.dao.CategoryDao;
import com.zhiyou100.model.Category;
import com.zhiyou100.vo.ResponseVo;

@RestController
public class CategoryController {

	@Autowired
	private CategoryDao categoryDao;
	@GetMapping("/categories")
	public ResponseVo<ArrayList<Category>> findAll(){
		
		ArrayList<Category> al = categoryDao.findAll();
		
		return new ResponseVo<ArrayList<Category>>(200, "请求成功", al);
		
		
	}
}
